package bb.lanxing.calc.data;

public class HeartratePoint implements Cloneable, RecycleData {
    private int heartrate;
    private int source = 2;

    public HeartratePoint copy(HeartratePoint reuse) {
        if (reuse == null) {
            reuse = new HeartratePoint();
        }
        reuse.heartrate = this.heartrate;
        reuse.source = this.source;
        return reuse;
    }

    public HeartratePoint clone() {
        try {
            return (HeartratePoint) super.clone();
        } catch (CloneNotSupportedException e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public void recycle() {
        this.heartrate = 0;
        this.source = 2;
    }

    public int getHeartrate() {
        return this.heartrate;
    }

    public void setHeartrate(int heartrate) {
        this.heartrate = heartrate;
    }

    public int getSource() {
        return this.source;
    }

    public void setSource(int source) {
        this.source = source;
    }
}
